package com.duoduo.common.core.exception;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
public enum ErrorCode {

	OK("0", "成功"),
	ERROR("500", "服务器错误"),
	PARAMTER_ERROR("501", "参数错误"), 
	TOOKEN_ERROR("502", "token验证失败"), 
	UNAUTHORIZED("401", "权限不足"), 
	ACCOUNT_DISABLE("402", "账户不可用"), 
	NOT_FIND("502","查询不存在"),
	PUBLICPARAM_ERROR("10001","系统内置参数不能删除或者修改"), 
	UPLOAD_FILE_ERROR("10002","上传文件失败"), 
	SYS_APP_SMS_ERROR("10003","验证码错误"), 
	SYS_APP_PHONE_UNREGISTERED("10004","手机号不正确"), 
	SYS_APP_SMS_OFTEN("10005","验证码发送频繁"), 
	SYS_USER_USERNAME_EXISTING("10006","用户名已存在"),
	SYS_PARAM_CONFIG_ERROR("10007","系统编码错误"),
	
	;
	
	
	public String value;
	
	public String memo;

	ErrorCode(String value, String memo) {
		this.value = value;
		this.memo = memo;
	}

	private static final Map<String, ErrorCode> lookup = new HashMap<String, ErrorCode>();

	static {
		for (ErrorCode s : EnumSet.allOf(ErrorCode.class)) {
			lookup.put(s.value, s);
		}
	}

	public static ErrorCode get(String value) {
		return lookup.get(value);
	}

}
